From 36a9323ec00c7cd9264a957b74fe8decb227f239 Mon Sep 17 00:00:00 2001 From: "sos22@douglas.cl.cam.ac.uk" Date: Fri, 11 Feb 2005 10:24:12 +0000 Subject: [PATCH] bitkeeper revision 1.1178 (420c87ccD2VdHFZVGUqHR4Zd2yI1mg) After a fatal trap, we want to debug whatever caused the trap rather than the trap handler. Fix things up accordingly. Also add some documentation while I'm here. Signed-off-by: sos22@cl.cam.ac.uk. --- xen/arch/x86/traps.c | 2 +- xen/include/asm-x86/debugger.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 53ff190ea8..12f2f1772b 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -123,7 +123,7 @@ asmlinkage void fatal_trap(int trapnr, struct xen_regs *regs) printk("System shutting down -- need manual reset.\n"); printk("************************************\n"); - debugger_trap_immediate(); + debugger_trap_fatal(trapnr, regs); /* Lock up the console to prevent spurious output from other CPUs. */ console_force_lock(); diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h index dc018f5bdb..62828329b8 100644 --- a/xen/include/asm-x86/debugger.h +++ b/xen/include/asm-x86/debugger.h @@ -17,6 +17,14 @@ * hook to drop into a debug session. It can also be used to hook off * deliberately caused traps (which you then handle and return non-zero) * but really these should be hooked off 'debugger_trap_entry'. + * + * 3. debugger_trap_immediate(): + * Called if we want to drop into a debugger now. This is essentially the + * same as debugger_trap_fatal, except that we use the current register state + * rather than the state which was in effect when we took the trap. + * Essentially, if we're dying because of an unhandled exception, we call + * debugger_trap_fatal; if we're dying because of a panic() we call + * debugger_trap_immediate(). */ #ifndef __X86_DEBUGGER_H__ -- 2.30.2